home *** CD-ROM | disk | FTP | other *** search
/ SGI Developer Toolbox 6.1 / SGI Developer Toolbox 6.1 - Disc 4.iso / src / exampleCode / games / IndiZone / blix / mymath.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-08-02  |  2.0 KB  |  57 lines

  1. /*
  2.  * Copyright (C) 1994, Silicon Graphics, Inc.
  3.  * All Rights Reserved.
  4.  *
  5.  * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, Inc.;
  6.  * the contents of this file may not be disclosed to third parties, copied or
  7.  * duplicated in any form, in whole or in part, without the prior written
  8.  * permission of Silicon Graphics, Inc.
  9.  *
  10.  * RESTRICTED RIGHTS LEGEND:
  11.  * Use, duplication or disclosure by the Government is subject to restrictions
  12.  * as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data
  13.  * and Computer Software clause at DFARS 252.227-7013, and/or in similar or
  14.  * successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -
  15.  * rights reserved under the Copyright Laws of the United States.
  16.  */
  17. /*_________________________________________________________________________
  18.  |
  19.  | mymath.h - define some additional constants and macros
  20.  |
  21.  | defines a few variables with float precision, and adds macros
  22.  | that work with degrees instead of radians; MIN, MAX and SQR can be
  23.  | found here too.
  24.  |
  25.  | (c) Frans van Hoesel, Xtreme Graphics Software, hoesel@chem.rug.nl
  26. */
  27.  
  28. #ifndef MYMATH_H__SEEN
  29. #include <math.h>
  30.  
  31. #define PI2 6.28318530717958647692
  32. #define PI2_f 6.28318530717958647692F
  33. #define PI 3.14159265358979323846
  34. #define PI_f 3.14159265358979323846F
  35. #define BY_PI 0.31830988618379067153
  36. #define BY_PI_f 0.31830988618379067153F
  37. #define GOLDEN 1.616803398874989484820
  38. #define GOLDEN_f 1.616803398874989484820F
  39. #define DEG_TO_RAD 0.01753292519943295769236907
  40. #define DEG_TO_RAD_f 0.01753292519943295769236907F
  41. #define RAD_TO_DEG 57.29577951308232087684636
  42. #define RAD_TO_DEG_f 57.29577951308232087684636F
  43. #define COS(x) cos((x) * DEG_TO_RAD)
  44. #define COS_f(x) cosf((x) * DEG_TO_RAD_F)
  45. #define SIN(x) sin((x) * DEG_TO_RAD)
  46. #define SIN_f(x) sinf((x) * DEG_TO_RAD_F)
  47. #define TAN(x) tan((x) * DEG_TO_RAD)
  48. #define TAN_f(x) tanf((x) * DEG_TO_RAD_F)
  49. #define MIN(x,y) ((x)<(y)?(x),(y))
  50. #define MAX(x,y) ((x)>(y)?(x),(y))
  51. #define SQR(x) ((x)*(x))
  52. #define ABS(x)    (((x) < 0) ? -(x) : (x))
  53.  
  54.  
  55. #define MYMATH_H__SEEN
  56. #endif
  57.